<?php
/**
 * ProjectName: Grapes.
 * Created by LemonZ.
 * FileName: Crontab.php
 * Date: 2019/2/14
 * Time: 21:31
 * Description:
 */

namespace app\index\controller;


use app\common\controller\Base;
use app\common\model\Order;

class Crontab extends Base
{
    /**
     * 取消订单
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function cancle()
    {
        $setting = getSetting('order_cancel_time');
        $model = new Order();
        $model->autoCancel($setting);
    }

    /**
     * 订单自动完成
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\exception\PDOException
     */
    public function complete()
    {
        $setting = getSetting('order_complete_time');
        $model = new Order();
        $model->autoComplete($setting);
    }

    /**
     * 自动评价订单
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\exception\PDOException
     */
    public function evaluate()
    {
        $setting = getSetting('order_autoEval_time');
        $model = new Order();
        $model->autoEvaluate($setting);
    }

    /**
     * 订单自动签收
     * @throws \think\Exception
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\exception\PDOException
     */
    public function sign()
    {
        $setting = getSetting('order_autoSign_time');
        $model = new Order();
        $model->autoSign($setting);
    }

    /**
     * 催付款
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function remind()
    {
        $setting = getSetting('order_cancel_time');
        $model = new Order();
        $model->remind_order_pay($setting);
    }
}